<?php
require_once 'FactoryModel.php';

/**
 * Implémentation d'une factory du model
 * 
 * @author Cyril Souti
 * @version 1.0
 * @package factory
 *
 */
class Factory_FactoryFormDefault implements Factory_FactoryForm {
	
	/**
	 * (non-PHPdoc)
	 * @see factory/Factory_FactoryForm#getContactForm()
	 */
	public function getContactForm() {
		$contactForm = $this->getGiteForm();
		$contactForm->makeFirstname();
		$contactForm->makeName();
		$contactForm->groupInline(array('prenom', 'nom'), 'nameGroup', array('legend' => ''));
		$contactForm->makeEmail();
		$contactForm->makeObject();
		$contactForm->makeEditorMessage();
		$contactForm->makeCaptcha();
		$contactForm->makeSubmit();
		
		return $contactForm;
	}
	
	/**
	 * (non-PHPdoc)
	 * @see factory/Factory_FactoryForm#getReservationForm()
	 */
	public function getReservationForm() {
		$reservationForm = $this->getGiteForm();
		
		return $reservationForm;
	}
	
	/**
	 * Fabrique un formulaire
	 * 
	 * @return Forms_GiteForm un formulaire
	 */
	private function getGiteForm() {
		$giteForm = new Forms_GiteForm();
		$giteForm->setTranslator(Manager::getTranslate());
		
		return $giteForm;
	}
}